{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 信息熵"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def entropy(p):\n",
    "    return -p * np.log(p) - (1-p) * np.log(1-p)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x = np.linspace(0.01, 0.99, 200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xl4VeW5/vHvk3kg80BIQkgCIZAwE8LkAI6AFhwrONWp\nHFqpbY+ealvbetrTWk972mqrUqrWOiLOVFFUFERkCvMYCAmQhCETmefk/f2R6C+lQDZk77328Hyu\ni+vKXnvJvhdp76y8613vEmMMSimlPIuP1QGUUkrZn5a7Ukp5IC13pZTyQFruSinlgbTclVLKA2m5\nK6WUB9JyV0opD6TlrpRSHkjLXSmlPJCfVR8cGxtrUlNTrfp4pZRyS5s3b64wxsT1tp9l5Z6amkpe\nXp5VH6+UUm5JRA7bsp8OyyillAfScldKKQ9kU7mLyAwRyReRAhF56DTv/5eIbOv+s0tEOkQk2v5x\nlVJK2aLXchcRX+BJYCaQBcwTkaye+xhjfmeMGWOMGQP8GFhtjKlyRGCllFK9s+XMPRcoMMYUGmNa\ngSXAnLPsPw941R7hlFJKnR9byj0JKO7xuqR7278RkRBgBvBm36MppZQ6X/a+oPoNYO2ZhmREZL6I\n5IlIXnl5uZ0/Wiml1FdsmedeCgzs8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xpx2Gp27sPH7/SvgeRHZSdfM\nkQeNMW6/UqSIvApMA2JFpAT4BeAPjus1vUNVKaU8kKsNyyillLIDLXellPJAWu5KKeWBtNyVUsoD\nabkrpZQH0nJXSikPpOWulFIeSMtdKaU80P8DxRKgg1w9LK8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x10fda0d30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x, entropy(x))\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
